<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('ads', function (Blueprint $table) {
            $table->increments('id');
            $table->string('link')->comment('广告链接');
            $table->string('title')->comment('广告语');
            $table->string('color')->default('FF0000')->comment('颜色');
            $table->string('border_color')->default('00F000')->comment('边框颜色');
            $table->integer('size')->default(30)->comment('文字尺寸');
            $table->boolean('flicker')->default(false)->comment('是否闪烁');
            $table->integer('user_id')->unsigned()->comment('关联用户ID');
            $table->integer('site_id')->unsigned()->comment('关联站点ID');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('ads');
    }
}
